package com.yyfax.pay.vo.depository;

import org.hibernate.validator.constraints.NotBlank;

import com.yyfax.framework.yyfax.enums.UserTypeEnum;
import com.yyfax.pay.common.exception.PayExceptionCode;

/**
 * 富友存管协议充值请求参数
 * 
 * @author buyi
 * @date 2018-06-20 10:18:20
 * @since v2.2.2
 */
@SuppressWarnings("serial")
public class ChargeProtocolSignRechargeReq extends ChargeBaseReq {

	/** 用户姓名 */
	@NotBlank(message = "subjectType不能为空")
	private String subjectType;

	public String getSubjectType() {
		return subjectType;
	}

	public void setSubjectType(String subjectType) {
		this.subjectType = subjectType;
	}

	@Override
	public void validParams() {
		super.validParams();

		// 判断枚举类型
		for (UserTypeEnum userTypeEnum : UserTypeEnum.values()) {
			if (userTypeEnum.getValue().equals(subjectType)) {
				return;
			}
		}

		throw PayExceptionCode.ERROR_ILL_PARAMETER.expMsg("subjectType非法");
	}

}
